package com.scsystem.xysc.controller;


import com.scsystem.xysc.aop.LogOperations;
import com.scsystem.xysc.pojo.vo.ReturnResult;
import com.scsystem.xysc.service.StoreFollowService;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.Parameter;
import io.swagger.v3.oas.annotations.Parameters;
import io.swagger.v3.oas.annotations.tags.Tag;
import jakarta.annotation.Resource;
import org.springframework.web.bind.annotation.*;

@RestController
@CrossOrigin
@RequestMapping("/storeFollow")
@Tag(name = "店铺关注接口")
public class StoreFollowController {

    @Resource
    private StoreFollowService storeFollowService;

    @GetMapping("/subscribe")
    @Operation(summary = "关注店铺")
    @Parameters({
            @Parameter(name = "uid", description = "用户id"),
            @Parameter(name = "sid", description = "店铺id")
    })
    @LogOperations(module = "店铺关注", operation = "添加店铺关注")
    public ReturnResult<Boolean> subscribe(Long uid, Long sid) {
        return storeFollowService.subscribe(uid, sid);
    }

    @GetMapping("/cancellation")
    @Operation(summary = "取消关注")
    @Parameters({
            @Parameter(name = "uid", description = "用户id"),
            @Parameter(name = "sid", description = "店铺id")
    })
    @LogOperations(module = "店铺关注", operation = "取消店铺关注")
    public ReturnResult<Boolean> cancellation(Long uid, Long sid) {
        return storeFollowService.cancellation(uid, sid);
    }

}
